package com.ruoyi.project.doc.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.doc.domain.DocPatient;
import com.ruoyi.project.doc.domain.DocReg;
import com.ruoyi.project.doc.service.IDocRegService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/doc/reg")
public class DocRegController extends BaseController {

        @Autowired
        private IDocRegService docRegService;

        @PreAuthorize("@ss.hasPermi('doc:reg:list')")
        @GetMapping("/list")
        public TableDataInfo list(DocReg docReg){
            startPage();
            List<DocReg> list = docRegService.selectDocRegList(docReg);
            return getDataTable(list);
        }

        @PreAuthorize("@ss.hasPermi('system:list:query')")
        @GetMapping(value = "/{id}")
        public AjaxResult getInfo(@PathVariable("id") Integer id){
            return AjaxResult.success(docRegService.selectDocRegById(id));
        }
}
